<?php
/**
* @project ApPHP Medical Appointment
* @copyright (c) 2012 ApPHP
* @author ApPHP <info@apphp.com>
* @license http://www.gnu.org/licenses/
*/

// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------

if($objLogin->IsLoggedInAsPatient()){
	
	draw_title_bar(prepare_breadcrumbs(array(_GENERAL=>"",_ACCOUNT_PANEL=>"")));
    
?>
	<div style="padding:5px 0;">
	<?php
	
		$msg = "<div style='padding:9px;min-height:250px'>";
        $welcome_text = _WELCOME_PATIENT_TEXT;
        $welcome_text = str_replace("_FIRST_NAME_", $objLogin->GetLoggedFirstName(), $welcome_text);
		$welcome_text = str_replace("_LAST_NAME_", $objLogin->GetLoggedLastName(), $welcome_text);
        $welcome_text = str_replace("_TODAY_", _TODAY.": <b>".format_datetime(@date('Y-m-d H:i:s'), '', '', true)."</b>", $welcome_text);
		$welcome_text = str_replace("_LAST_LOGIN_", _LAST_LOGIN.": <b>".format_datetime($objLogin->GetLastLoginTime(), '', '', true)."</b>", $welcome_text);
		$welcome_text = str_replace("_DASHBOARD_", _DASHBOARD, $welcome_text);
        $welcome_text = str_replace("_EDIT_MY_ACCOUNT_", _EDIT_MY_ACCOUNT, $welcome_text);
		$welcome_text = str_replace("_MY_APPOINTMENTS_", _MY_APPOINTMENTS, $welcome_text);
        $msg .= $welcome_text;
		$msg .= "<p><br /></p>";
        $msg .= "</div>";	
	
		draw_message($msg);		
	?>
    </div>
<?php
}else if($objLogin->IsLoggedIn()){
    draw_title_bar(prepare_breadcrumbs(array(_GENERAL=>"")));
    draw_important_message(_NOT_AUTHORIZED);
}else{
    draw_title_bar(prepare_breadcrumbs(array(_PATIENT=>"")));
    draw_important_message(_MUST_BE_LOGGED);
}
?>